Technote FL 34 | January 1987 |
When a mounted volume is placed offline, vcbDrvNum is cleared and vcbDRefNum is set to the two's complement of the drive number. Since drive numbers are assigned positive values (starting with one), this will be a negative number. If vcbDrvNum is zero and vcbDRefNum is negative, you know that the volume is offline.
When a volume is ejected, vcbDrvNum is cleared and vcbDRefNum is set to the positive drive number. If vcbDrvNum is zero and vcbDRefNum is positive, you know that the volume is ejected. Ejection implies being offline. There is no such thing as "premature ejection".
online offline ejected
vcbDrvNum >0 (DrvNum) 0 0 vcbDRefNum <0 (DRefNum) <0 (-DrvNum) >0 (DrvNum)
Please refrain from assuming anything about a VCB queue element beyond what is
documented in Inside Macintosh, and don't expect it to always be 178
bytes in size. It grew when we went from MFS to HFS, and it may grow again.
It's safest to use calls like PBHGetVInfo to get the information that
you need.
Further Reference: